package com.atguigu.gmall.search.entity;

import lombok.Builder;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author lfy
 * @Description
 * @create 2023-07-22 14:47
 */
@Builder
@Data
@Document(indexName = "movie",shards = 1,replicas = 1) //说明对应哪个索引
//https://docs.spring.io/spring-data/elasticsearch/docs/4.4.14/reference/html/#elasticsearch.mapping
public class Movie {
    @Id
    private Long id;
    @Field(name="movieName")
    private String movieName;
    @Field(name="daoyan")
    private String daoyan;

    @Field(name="upTime",type= FieldType.Date,format = DateFormat.custom,pattern = "yyyy-MM-dd HH:mm:ss")
    private Date upTime;

    @Field(name = "price",type = FieldType.Double)
    private BigDecimal price;
}
